﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web;

namespace yule.Web.Web.Controllers
{
    /// <summary>
    /// 首页
    /// </summary>
    public class HomeController : BaseController
    {
        //[OutputCache(Duration = 10)]
        public ActionResult Index()
        {
            /*
            string int_key = "int_key";
            yule.Common.CacheManager.Set(int_key, 0);
            */
            
            string index = null;

            if (yule.Common.CacheManager.ShareCache.Get<string>("index") == null)
            {
                yule.Common.CacheManager.ShareCache.Set<string>("index", new Random().Next(100, 10000) + "");
            }

            index = yule.Common.CacheManager.ShareCache.Get<string>("index");
            //ViewData.Model = index;

            /*
            yule.IService.Sys.IUser userService = yule.Common.ServiceManager.ServiceContext.CreateService<yule.IService.Sys.IUser>();

            userService.GetUser("");
            */


            yule.IDAL.Sys.IUser userDAL = this.ServiceContext.CreateService<yule.IDAL.Sys.IUser>();

            IList<yule.Model.Sys.User> list = userDAL.List();

            yule.IService.Sys.IRegion regionService = yule.Common.ServiceManager.ServiceContext.CreateService<yule.IService.Sys.IRegion>();

            ViewData.Model = regionService.GetRegion("350100");

            return View();
        }

        public ActionResult Int_Key()
        {
            return this.View();
        }



    }
}
